from openai import OpenAI
from globle import configs as cfg
client = OpenAI(api_key=cfg.DEEPSEEK_API_KEY, base_url="https://api.deepseek.com")

'''
需求：生成"自我介绍", 假设面试AI岗，根据用户提供的背景生成。
'''
def gen(background):
    completion = client.chat.completions.create(
        model="deepseek-chat",
        messages=[
            {"role": "system","content": "你是一个帮助我生成自我介绍的助手，我要面试的AI岗位，根据我的背景，生成内容"},
            {
                    "role": "user",
                    "content": f"我的背景是:{background}"
            },
        ],
    )
    return completion.choices[0].message.content

print(gen("我叫张三，20岁，上海, 英语专业，有点实习经验"))


